// StatusWorker.h
#ifndef STATUSWORKER_H
#define STATUSWORKER_H

#include <QObject>
#include <QTimer>
#include <QThread>

class RobotController;

class StatusWorker : public QObject
{
    Q_OBJECT

public:
    explicit StatusWorker(int interval, QObject *parent = nullptr);
    ~StatusWorker();

public slots:
    void start();
    void stop();

signals:
    void requestBattery(int cmdId);             //电量
    void requestPosition(int cmdId);            //位置
    void requestNavState(int cmdId);            //导航状态
    void requestControlAuthority(int cmdId);    //控制权
    void requestRobotAlarmStatus(int cmdId);    //查询机器人报警状态

private slots:
    void onTimeout();

private:
    QTimer *m_timer = nullptr; // 指针，延迟初始化
    int m_interval;   // 存储间隔时间
};

#endif // STATUSWORKER_H